package cyclon.system.peer.cyclon;

import java.util.HashMap;
import java.util.UUID;

import common.peer.DescriptorBuffer;
import common.peer.PeerMessage;
import common.peer.PeerAddress;

public class ShuffleResponse extends PeerMessage {
	private static final long serialVersionUID = -5022051054665787770L;
	private final UUID requestId;
	private final DescriptorBuffer randomBuffer;
	//Stores the node frequencies in a peer's view for each BW capacity
	HashMap<Integer, Float> peerCounts = new HashMap<Integer, Float>();

//-------------------------------------------------------------------
	public ShuffleResponse(UUID requestId, DescriptorBuffer randomBuffer, PeerAddress source, PeerAddress destination) {
		super(source, destination);
		this.requestId = requestId;
		this.randomBuffer = randomBuffer;
	}

//-------------------------------------------------------------------
	public UUID getRequestId() {
		return requestId;
	}

//-------------------------------------------------------------------
	public DescriptorBuffer getRandomBuffer() {
		return randomBuffer;
	}
	
//-------------------------------------------------------------------
	
	public void putPeerCount(Integer bw, Float count)
	{
		peerCounts.put(bw, count);
	}
	
	public HashMap<Integer, Float> getPeerCounts()
	{
		return peerCounts;
	}
	
//-------------------------------------------------------------------
	public int getSize() {
		return 0;
	}
}
